package com.shu.framework.redis;

public abstract class BaseProfix implements KeyPrefix {

    private int expireSeconds;
    //key
    private String prefix;
    public BaseProfix(String prefix) {
        //0代表永远不过期
        this(0, prefix);
    }
    public BaseProfix(int expireSeconds,String prefix){
        this.expireSeconds=expireSeconds;
        this.prefix=prefix;
    }
    @Override
    public int expireSeconds() {

        return expireSeconds;
    }

    @Override
    public String getPrefix() {
        String className = getClass().getSimpleName();
        return className+":"+prefix;
    }
}
